﻿using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Linq;
using System.Text;
using System.ComponentModel;
using System.Xml.Serialization;

namespace twilters
{
    public class FilterSheet : INotifyPropertyChanged
    {
        private ObservableCollection<FilterLineItem> lineItems;
	
        public event PropertyChangedEventHandler PropertyChanged;

        public FilterSheet() {
            lineItems = new ObservableCollection<FilterLineItem>();
        }

        [XmlArray("lineitems")]
        [XmlArrayItem("lineitem", typeof(FilterLineItem))]
        public ObservableCollection<FilterLineItem> LineItems
        {
            get { return lineItems; }

            set {
                if (value != this.lineItems) {
                    this.lineItems = value;
                    NotifyPropertyChanged("LineItems");
                }
            }
        }

        private void NotifyPropertyChanged(string info) {
            if (PropertyChanged != null) {
                PropertyChanged(this, new PropertyChangedEventArgs(info));
            }
        }
    }
}
